//
//  ZJTabBarController.m
//  PersonalHospital
//
//  Created by qianfeng on 15/12/11.
//  Copyright (c) 2015年 QianFeng. All rights reserved.
//

#import "ZJTabBarController.h"

@interface ZJTabBarController ()

@end

@implementation ZJTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    [self makeTabBarItem];
}

-(void)makeTabBarItem{
    NSArray * titles=@[@"中医治疗",@"西医问药",@"修养之道",@"个人中心"];
    NSArray * images=@[@"Traditional",@"Western",@"Health",@"Personal"];
    NSMutableArray * Controllers=[[NSMutableArray alloc]init];
    
    for (int i=0; i<titles.count; i++) {
        Class class=NSClassFromString([images[i] stringByAppendingString:@"ViewController"]);
        
        UIViewController * vc=[[class alloc]init];
        
        vc.title=titles[i];
        
        UINavigationController * nav=[[UINavigationController alloc]initWithRootViewController:vc];
//        UIView * view=[[UIView alloc]initWithFrame:CGRectMake(0, 0,self.view.frame.size.width, self.view.frame.size.height)];
//        view.backgroundColor=[UIColor colorWithRed:244/255.0 green:230/255.0 blue:201/255.0 alpha:1];
//        nav.navigationItem.titleView=view;
        
        //vc.navigationController.navigationBar.barTintColor=[UIColor colorWithRed:244/255.0 green:230/255.0 blue:201/255.0 alpha:1];
        
        [Controllers addObject:nav];
        
        UITabBarItem * item=[[UITabBarItem alloc]initWithTitle:titles[i] image:[[UIImage imageNamed:images[i]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]selectedImage:[[UIImage imageNamed:[images[i] stringByAppendingString:@"_s"]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
        
        vc.tabBarItem=item;
    }
    self.viewControllers=Controllers;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
